
<div class="content">
    <div class="tabb">
	<a href="<?php echo SITE_NAME_URL ?>">Home</a>		
	<span>Check out</span>
    </div>

    <div class="text-main">
	<div class="left-main">
	    <div class="box-left">
		<ul class="left-menu ">
		    <?php foreach ($aCat as $cat) { ?>
    		    <li><a href="<?php echo url('product/list_product/' . $cat['category_id']) ?>"><?php echo $cat['name'] ?></a></li>
		    <?php } ?>
		</ul>
	    </div>
	</div><!--left-main-->
	<div class="right-main">
	    <?php
	    if (isset(Yii::app()->session['order'])) {
		?>
    	    <div class="bordered">
    		<table>
    		    <tr>
    			<th></th>
    			<th>Name</th>
    			<th>Quantity</th>
    			<th>Total</th>
    			<th></th>
    		    </tr>
			<?php
			$totalPurchase = 0;
			foreach (Yii::app()->session['order'] as $key => $order) {
			    $totalPurchase += $order['total_purchase'];
			    ?>
			    <tr>
				<td class="td-img-product"><?php
				    if ($order['model_id'] == OrderDetail::MODEL_CUSTOM_PHONE) {
					echo "<img src='" . DESIGN_PHONE_URL . $order['image_designed'] . "' class='img-in-checkout'/>";
				    } else {
					echo "<img src='" . PRODUCT_URL . $order['image_product'] . "' class='img-in-checkout'/>";
				    }
				    ?></td>
				<td><?php echo $order['name']; ?></td>
				<td><?php echo $order['total_order']; ?></td>
				<td>$<span class="total-purchase-checkout"><?php echo $order['total_purchase']; ?></span></td>
				<td>
				    <?php
				    if ($order['model_id'] == OrderDetail::MODEL_CUSTOM_PHONE) {
					?>
	    			    <a href="<?php echo url('customcase/customcase/edit', array('id' => $key)) ?>"><i class="icon-edit"></i></a>
					<?php
				    }
				    ?>
				    <a href="javascript:void(0)" class="delete-order" id-arr-order="<?php echo $key ?>"><i class="icon-trash"></i></a>
				</td>
			    </tr>
			    <?php
			}
			?>
    		    <tr>
    			<td colspan="5" style="text-align: center;">Total: $<?php echo $totalPurchase; ?></td>
    		    </tr>
    		</table>
    	    </div>
		<?php
	    }
	    ?>
	</div><!--right-main-->

    </div><!--box-left-->


</div><!--content-->


